package cn.edu.jxau.admin.controller;

import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.edu.jxau.domain.user;
import cn.edu.jxau.domain.userInfo;
import cn.edu.jxau.service.readUserInfo;

public class readUserInfoServlet extends HttpServlet {

	/**
	 * 读取用户基本信息显示在后台
	 */
	private static final long serialVersionUID = 1L;

	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		response.setContentType("text/html;charset=utf-8");
        request.setCharacterEncoding("utf-8");
        
        HashMap<user,userInfo> map=(HashMap<user, userInfo>) readUserInfo.queryUserInfo();//读出用户信息封装进Map集合
    
        request.getSession().setAttribute("info", map);
         
        response.sendRedirect("admin/userManage.jsp");
    
	}
	 @Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		 doGet(req,resp);
	}

	
}
